<template>
  <div class="c-flex-row c-aligni-center c-ph24 c-pt34" :style="getVerticalSpacing(marginSettings, 3) + getHorizontalSpacing(marginSettings)">
    <div class="c-w0 c-flex-grow1 c-flex-row c-aligni-center c-lh32 c-hh32" :style="getHeadLineTitle(headLine)"
      :class="[pageTextColor ? 'pageTextColor' : '', position == 2 ? 'c-justify-center' : '']">
      <span class="c-text-ellipsis1">
        <span class="c-fs28 c-lh32" :style="getHeadLineTitle(headLine)" v-if="titleName">{{titleName}}</span>
        <span class="c-fs24 c-lh28 c-ml20 c-mr16" :class="pageTextColor ? 'pageTextColor' : 'c-fc-sblack'" :style="getHeadLineSmallTitle(headLine)" v-if="titleDesc">{{titleDesc}}</span>
      </span>
    </div>
    <!-- 预告二维码 -->
    <div v-if="modelType == 15 && visible && visible.qrVisible" @click="clickMore" :class="pageTextColor ? 'pageTextColor' : 'c-fc-gray'">
      <span class="iconfont c-fs18">&#xe71f;</span>
      <span class="c-fs18 c-pl8">二维码</span>
    </div>
    <template v-else-if="showMore != 1 && modelType != 15">
      <div class="c-fs18 c-p" :class="pageTextColor ? 'pageTextColor' : 'c-fc-gray'" :style="getHeadLineMore(headLine)">
        <div v-if="showMoreType == 2" @click="clickMore">更多</div>
        <div v-else-if="showMoreType == 3" @click="clickMore" class="iconfont">&#xe908;</div>
        <div v-else @click="clickMore" class="c-flex-row c-aligni-center">
          <span>更多</span><i class="iconfont c-scale80 c-fs18" :style="getHeadLineMore(headLine)">&#xe908;</i>
        </div>
        <wx-open-launch-weapp
          v-if="launchWeapp"
          :id="'launchBtn'"
          :appId="launchWeapp.appID"
          :path="launchWeapp.wechatUrl"
          class="c-w100 c-h c-text-hidden c-pa c-p-t0 c-p-l0"
          @error="handleErrorFn"
          @launch="handleLaunch"
          @ready="handleReady"
        >
          <script type="text/wxtag-template">
            <style>.masker {width: 100%;height: 40px;opacity: 0}</style>
            <span class="masker">立即跳转</span>
          </script>
        </wx-open-launch-weapp>
      </div>
    </template>
  </div>
</template>
<script>
import { customStyle } from '@/utils/customStyle.js'
export default {
  name: "CampIndexCom",
  mixins: [customStyle],
  props: {
    titleName: {
      type: String,
      default: ""
    },
    titleDesc: {
      type: String,
      default: ""
    },
    showMore: {
      type: Number,
      default: 0,
    },
    showMoreType: {
      type: Number,
      default: 1,
    },
    headLine: {
      type: Object,
      default: null
    },
    marginSettings: {
      type: Object,
      default: null
    },
    modelType: {
      type: Number,
      default: 0
    },
    position: {
      type: Number,
      default: 0
    },
    visible: {
      type: Object,
      default: null
    },
    launchWeapp: { // 设置小程序跳转对象
      type: Object,
      default: null
    }
  },
  data() {
    return {
      isiOS: !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
      pageTextColor: sessionStorage.getItem('pageTextColor') || '',
    };
  },
  computed: {
  },
  activated() {
  },
  methods: {
    clickMore() {
      this.$emit('clickMore')
    },
  },
};
</script>